#@cmsLayout()

#define cmsContent()
<div class="cms-breadcrumb">
	<i class="layui-icon layui-icon-flag"></i>
	<span class="layui-breadcrumb">
	  	<a href="">文章管理</a>
	  	<a><cite>文章管理</cite></a>
	</span>
</div>

<div class="body-card layui-card">
	<div class="">
		<form class="layui-form" action="#(ctx)/cmsArt/enterArtMng" method="post" onsubmit="return false;">
  			<div class="layui-inline">
	    		<label class="layui-form-label">标题</label>
	   			<div class="layui-input-inline">
	      			<input type="text" name="title" placeholder="请输入标题" class="layui-input" value="#(title)">
	    		</div>
  			</div>
  			<div class="layui-inline">
    			<label class="layui-form-label">栏目</label>
    			<div class="layui-input-inline">
      				<select name="column">
	      				<option value="0">请选择文章所属栏目</option>###这个必须得有，不然页面显示会乱
					  	#for(x : artColumnsMap)
					  	<optgroup label="#(x.key)">
					  		#for(l : x.value)
					  		<option value="#(l.id)" #if(column.toInt()??==l.id) selected #end>#(l.name)</option>
					  		#end
					  	</optgroup>
					  	#end
					</select>  
    			</div>
  			</div>
  			<div class="layui-inline">
    			<label class="layui-form-label">类型</label>
    			<div class="layui-input-inline">
      				<select name="type">
	      				<option value="0">全部</option>
	      				<option value="1" #if(type=='1') selected #end>文章</option>
	      				<option value="2" #if(type=='2') selected #end>图文</option>
	      				<option value="3" #if(type=='3') selected #end>视频</option>
					</select>  
    			</div>
  			</div>
  			<div class="layui-inline">
		    	<div class="layui-input-inline">
		      		<button class="layui-btn" onclick="ajaxSearchForm('.layui-form','#rightMain')">查询</button>
		    	</div>
		  	</div>
  		</form>
	</div>
	<table class="layui-table">
	  	<colgroup>
	    	<col width="80">
	    	<col>
	    	<col width="80">
	    	<col width="100">
	    	<col width="80">
	    	<col width="100">
	    	<col width="100">
	    	<col width="100">
	  	</colgroup>
	 	<thead>
	    	<tr>
	      		<th>序号</th>
	      		<th>标题</th>
	      		<th>点击数</th>
	      		<th>栏目</th>
	      		<th>类型</th>
	      		<th>创建人</th>
	      		<th>更新人</th>
	      		<th>操作</th>
	    	</tr> 
	  	</thead>
	  	<tbody>
	  		#for(x : artPage.getList())
	    	<tr>
	      		<td>#(for.count)</td>
	      		<td>#(x.title)</td>
	      		<td>#(x.clickNum)</td>
	      		<td>#(x.columnName)</td>
	      		<td>
	      			#if(x.type=='1')
	      				<button type="button" class="layui-btn layui-btn-normal layui-btn-xs">
							<i class="layui-icon layui-icon-file-b"></i> 文章
						</button>
	      			#else if(x.type=='2')
	      				<button type="button" class="layui-btn layui-btn-warm layui-btn-xs">
							<i class="layui-icon layui-icon-picture"></i> 图文
						</button>
					#else if(x.type=='3')
	      				<button type="button" class="layui-btn layui-bg-cyan layui-btn-xs">
							<i class="layui-icon layui-icon-video"></i> 视频
						</button>
	      			#else
	      				未定义
	      			#end
	      		</td>
	      		<td>#(x.createAccountName)</td>
	      		<td>#(x.updateAccountName)</td>
	      		<td>
	      			<a class="pjax-a layui-btn layui-btn-xs" href="#(ctx)/cmsArt/enterArtEdit/#(x.id)-#(x.type)" title="编辑">
	      				<i class="layui-icon layui-icon-edit"></i>
	      			</a>
	      			<a onclick="ajaxDelete('#(ctx)/cmsArt/deleteArt/#(x.id)')" title="删除" class="layui-btn layui-btn-xs layui-bg-red" href="javascript:;">
	      				<i class="layui-icon layui-icon-delete"></i>
	      			</a>
	      		</td>
	    	</tr>
	    	#end
	  	</tbody>
	</table>
	###分页
	#set(append='')
	#if(title)
		#set(append=append+'&title='+title)
	#end
	#if(column)
		#set(append=append+'&column='+column)
	#end
	#if(type&&type!='0')
		#set(append=append+'&type='+type)
	#end
	#@paginate?(artPage.totalRow, artPage.pageNumber, artPage.totalPage, '/cmsArt/enterArtMng?page=')
</div>
#@jsInit()
#end